﻿using agsXMPP;

namespace sharpxbot.Core.Muc
{
    /// <summary>
    /// Allows to determine that there exists group-chat with given jid in this context.
    /// Allows plugins to separate group-chat messages from private group-chat messages ( e.g. private message
    /// inside group-chat
    /// </summary>
    public interface IGroupChatContext
    {
        /// <summary>
        /// Gets private jid of group-chat user. 
        /// E.g. user is sitting in conference@xmpp.org and has public jid conference@xmpp.org/userResource.
        /// Method will return actual user jid (e.g. user@server.com)
        /// </summary>
        /// <param name="publicUserJid">Public user's jid from group-chat ( e.g. conference@xmpp.org/userResource ) </param>
        /// <returns>Private user jid ( e.g. user@server.com )</returns>
        Jid GetPrivateUserJid(Jid publicUserJid);

        /// <summary>
        /// Kicks participant from group-chat with given jid
        /// </summary>
        /// <param name="roomBareJid">Group-chat jid</param>
        /// <param name="nick">Participant nick</param>
        /// <param name="reason">Reason of kick</param>
        void KickUser(string roomBareJid, string nick, string reason);

        /// <summary>
        /// Leaves room for a given timeout the rejoins it
        /// </summary>
        /// <param name="roomBareJid">Bare jid of group-chat to be temporaly left</param>
        /// <param name="timeout">Positive timeout in milliseconds</param>
        void LeaveRoom(string roomBareJid, int timeout);
    }
}
